package com.kx.smsplatform.handler;

import com.kx.smsplatform.util.R;
import com.kx.smsplatform.vo.ResultVO;
import com.kx.smsplatform.common.exception.SmsException;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author Sun
 * @Date 2021/7/1 19:51
 */
@RestControllerAdvice
public class SmsExceptionHandler {

    //定义需要进行处理拦截的类
    @ExceptionHandler(SmsException.class)
    public ResultVO smsException(SmsException ex){
        return R.error(ex);
    }
}
